<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="/WEB-INF/webpage/common/taglibs.jspf"%>
<!DOCTYPE html>
<html>
<head>
    <title>系统流程单据信息配置</title>
    <meta name="decorator" content="form"/>
    <html:css name="bootstrap-fileinput" />
    <html:css name="simditor" />
    <script type="text/javascript" src="${staticPath}/common/js/enter-restrict.js"></script>
</head>

<body class="white-bg"  formid="billActConfigForm">
    <form:form id="billActConfigForm" modelAttribute="data" action="${adminPath}/sys/billactconfig/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<form:hidden path="menuId"/>
		<table  class="table table-bordered  table-condensed dataTables-example dataTable no-footer">
		   <tbody>
				<tr>
					<td  class="width-15 active text-right">	
		              <label><font color="red">*</font>菜单:</label>
		            </td>
					<td class="width-35">
						<form:input path="menuName" htmlEscape="false" class="form-control" disabled="true"   />
						<label class="Validform_checktip"></label>
					</td>
					<td  class="width-15 active text-right">	
		              <label><font color="red">*</font>表单地址:</label>
		            </td>
					<td class="width-35">
						<form:input path="formUrl" htmlEscape="false" class="form-control"  datatype="*" 
							placeholder="请填写打开表单的地址,从项目之后的路径开始,参数id用{id}代替"   />
						<label class="Validform_checktip"></label>
					</td>
				</tr>
				<tr>
					<td  class="width-15 active text-right">	
		              <label><font color="red">*</font>表单地址:</label>
		            </td>
					<td class="width-35">
						<form:input path="appFormUrl" htmlEscape="false" class="form-control"  datatype="*" 
							placeholder="app显示表单的地址,从项目之后的路径开始,参数id用{id}代替"   />
						<label class="Validform_checktip"></label>
					</td>
				</tr>
				<tr>
					<td  class="width-15 active text-right">	
		              <label><font color="red">*</font>主键字段:</label>
		            </td>
					<td class="width-35">
						<form:input path="idFeild" htmlEscape="false" class="form-control"  datatype="*" placeholder="请填写数据库主键字段"
							onkeyup="enterLetter(this)" onafterpaste="enterLetter(this)" defaultValue="id"   />
						<label class="Validform_checktip"></label>
					</td>
					<td  class="width-15 active text-right">	
		              <label><font color="red">*</font>状态字段:</label>
		            </td>
					<td class="width-35">
						<form:input path="statusFeild" htmlEscape="false" class="form-control"  datatype="*" placeholder="请填写数据库状态字段"
							onkeyup="enterLetter(this)" onafterpaste="enterLetter(this)" defaultValue="status" />
						<label class="Validform_checktip"></label>
					</td>
				</tr>
				<tr>
					<td  class="width-15 active text-right">	
		              <label><font color="red">*</font>属性类型:</label>
		            </td>
					<td class="width-35">
						<form:select path="type" htmlEscape="false" class="form-control"  datatype="*" dict="billConfigType" onchange="setPropIsShow(this.value)"  />
						<label class="Validform_checktip"></label>
					</td>
					<td  class="width-15 active text-right">	
		              <label><font color="red">*</font>是否自动提交:</label>
		            </td>
					<td class="width-35">
						<form:radiobuttons path="isAutoSubmit" htmlEscape="false" class="form-control" defaultValue="0" 
							datatype="*" dict="sf"  delimiter="&nbsp;&nbsp;" cssClass="i-checks required" />
						<label class="Validform_checktip"></label>
					</td>
				</tr>
				<tr>
					<td  class="width-15 active text-right">	
		              <label><font color="red">*</font>允许类型:</label>
		            </td>
					<td class="width-35">
						<form:select path="allowType" htmlEscape="false" class="form-control"  datatype="*" 
							dict="allowType" onchange="allowType(this.value)"   />
						<label class="Validform_checktip"></label>
					</td>
					<td  class="width-15 active text-right">	
		              <label>允许修改的属性:</label>
		            </td>
					<td class="width-35">
						<form:input path="allowModifyProperty" htmlEscape="false" class="form-control" placeholder="请填写允许修改的表单属性,多个用“,”号隔开"   />
						<label class="Validform_checktip"></label>
					</td>
				</tr>
				<tr>
					<td  class="width-15 active text-right table-name">	
		              <label><font color="red">*</font>表名:</label>
		            </td>
					<td class="width-35 table-name">
						<form:input path="tableName" htmlEscape="false" class="form-control" placeholder="请填写数据库表名"     />
						<label class="Validform_checktip"></label>
					</td>
					<td  class="width-15 active text-right class-name">	
		              <label><font color="red">*</font>类名:</label>
		            </td>
					<td class="width-35 class-name">
						<form:input path="className" htmlEscape="false" class="form-control" placeholder="请填写类的全路径名称"     />
						<label class="Validform_checktip"></label>
					</td>
					<td  class="width-15 active text-right">	
		              <label>单据名称:</label>
		            </td>
					<td class="width-35">
						<form:input path="billName" htmlEscape="false" class="form-control"      />
						<label class="Validform_checktip"></label>
					</td>
				</tr>
				<tr>
					<td  class="width-15 active text-right">	
		              <label>保存表单地址:</label>
		            </td>
					<td class="width-35" colspan="3">
						<form:input path="formSaveUrl" htmlEscape="false" class="form-control"      />
						<label class="Validform_checktip"></label>
					</td>
				</tr>
				<tr>
					<td  class="width-15 active text-right">	
		              <label><font color="red">*</font>限制类型:</label>
		            </td>
					<td class="width-35">
						<form:select path="limitType" htmlEscape="false" class="form-control" 
							dict="limitSubmitType" onchange="setLimitDate(this.value)"    />
						<label class="Validform_checktip"></label>
					</td>
					<td  class="width-15 active text-right">	
		              <label><font color="red">*</font>是否回调:</label>
		            </td>
					<td class="width-35">
						<form:select path="isCallBack" htmlEscape="false" class="form-control" 
							dict="sf" defaultValue="0" onchange="setCallBack(this.value)"    />
						<label class="Validform_checktip"></label>
					</td>
				</tr>
				<tr class="callBack">
					<td  class="width-15 active text-right">	
		              <label>回调类名:</label>
		            </td>
					<td class="width-35">
						<form:input path="callClass" htmlEscape="false" class="form-control" 
							 placeholder="请输入调用方法类的全路径"  />
						<label class="Validform_checktip"></label>
					</td>
					<td  class="width-15 active text-right">	
		              <label>回调方法:</label>
		            </td>
					<td class="width-35">
						<form:input path="callMethod" htmlEscape="false" class="form-control"
							placeholder="请输入调用方法类的名称"   />
						<label class="Validform_checktip"></label>
					</td>
				</tr>
				<tr class="limitSubmit">
					<td  class="width-15 active text-right">	
		              <label>限时开始日期:</label>
		            </td>
					<td class="width-35">
						<form:input path="limitSubmitStartDate" htmlEscape="false" class="form-control" placeholder="YYYY-MM-DD"
							onclick="laydate({istime: false, format: 'YYYY-MM-DD'})" datefmt="yyyy-MM-dd"   />
						<label class="Validform_checktip"></label>
					</td>
					<td  class="width-15 active text-right">	
		              <label>限时结束日期:</label>
		            </td>
					<td class="width-35">
						<form:input path="limitSubmitEndDate" htmlEscape="false" class="form-control" placeholder="YYYY-MM-DD"
							onclick="laydate({istime: false, format: 'YYYY-MM-DD'})" datefmt="yyyy-MM-dd"   />
						<label class="Validform_checktip"></label>
					</td>
				</tr>
				
				<tr>
					<td  class="width-15 active text-right">	
		              <label><font color="red">*</font>任务审批地址:</label>
		            </td>
					<td class="width-35">
						<form:input path="taskAuditeUrl" htmlEscape="false" class="form-control"  datatype="*" placeholder="请填写pc端任务审批地址"
							defaultValue="activiti/flow/flowAudit?taskId="   />
						<label class="Validform_checktip"></label>
						<!-- meter/billreview/{billId}/taskinfo -->
					</td>
					<td  class="width-15 active text-right">	
		              <label><font color="red">*</font>任务签收地址:</label>
		            </td>
					<td class="width-35">
						<form:input path="taskSignUrl" htmlEscape="false" class="form-control"  datatype="*" placeholder="请填写任务签收地址"
							defaultValue="activiti/flow/personal/needDisposeTask" />
						<label class="Validform_checktip"></label>
					</td>
				</tr>
				
				<tr>
					<td  class="width-15 active text-right">	
		              <label>自定义sql:</label>
		            </td>
					<td class="width-35" colspan="3">
						<form:textarea path="customSql" htmlEscape="false" class="form-control" rows="4" placeholder="自定义sql获取表单信息，多个表关联查询,mybatis查询sql,参数字段名为#加{}替换"    />
						<label class="Validform_checktip"></label>
					</td>
				</tr>
				<tr>
					<td  class="width-15 active text-right">	
		              <label>字段描述:</label>
		            </td>
					<td class="width-35" colspan="3">
						<form:textarea path="propDescription" htmlEscape="false" class="form-control" rows="4" placeholder="查询单据信息的sql字段描述，例如编号：number"    />
						<label class="Validform_checktip"></label>
					</td>
		  		</tr>
		  		<!-- 消息提醒模板 -->
		  		<tr>
					<td  class="width-15 active text-right">	
		              <label><font color="red">*</font>消息提醒模板:</label>
		            </td>
					<td class="width-35" colspan="3">
						<form:textarea path="noticeTemplet" htmlEscape="false" datatype="*" class="form-control" rows="2" placeholder="配置消息提示显示内容"    />
						<label class="Validform_checktip"></label>
					</td>
		  		</tr>
		  		<tr>
		  			<td  class="width-15 active text-right">	
		              <label>备注信息:</label>
		            </td>
					<td class="width-35" colspan="3">
						<form:textarea path="remarks" htmlEscape="false" class="form-control" rows="4"     />
						<label class="Validform_checktip"></label>
					</td>
		  		</tr>
		      
		   </tbody>
		</table>   
	</form:form>
<html:js name="bootstrap-fileinput" />
<html:js name="simditor" />
<script type="text/javascript">

/**
 * @description 加载JS.<br>
 * @date 2018/8/27.<br>
 * @author zcg .<br>
 */
$(function(){
	var type = '${data.type}';
	var limitType = '${data.limitType}';
	var isCall = '${data.isCallBack}';
	setPropIsShow(type);
	setIsAutoSubmit();
	setLimitDate(limitType);
	setCallBack(isCall);
});

/**
 * @description 设置表名或者类型的显示与隐藏.<br>
 * @date 2018/8/27.<br>
 * @author zcg .<br>
 */
function setPropIsShow(value){
	if(value!='LM'){
		$('.class-name').hide();
		$('.table-name').show();
		$('#tableName').attr('datatype','*');
		$('#className').removeAttr('datatype');
	}else{
		$('.table-name').hide();
		$('.class-name').show();
		$('#className').attr('datatype','*');
		$('#tableName').removeAttr('datatype');
	}
}

/**
 * @description 根据允许类型设置字段.<br>
 * @date 2018/8/27.<br>
 * @author zcg .<br>
 */
function allowType(value){
	 debugger
	if(value=='BFYX'){
		$('#allowModifyProperty').attr('datatype','*');
	}else{
		$('#allowModifyProperty').removeAttr('datatype');
	}
}

/**
 * @description 初始化是自动提交.<br>
 * @date 2018/8/27.<br>
 * @author zcg .<br>
 */
function setIsAutoSubmit(){
	var value = '${data.isAutoSubmit}';
	if(value=='true'){
		$("input[name=isAutoSubmit][value=1]").attr("checked", true);
	}else{
		$("input[name=isAutoSubmit][value=0]").attr("checked", true);
	}
}
 
 /**
  * @description 设置限时.<br>
  * @date 2018/8/27.<br>
  * @author zcg .<br>
  */
 function setLimitDate(value){
	  if(!value||value=='BXS'){
		  $('.limitSubmit').hide();
		  $('#limitSubmitStartDate').removeAttr('datatype');
		  $('#limitSubmitEndDate').removeAttr('datatype');
	  }else{
		  $('.limitSubmit').show();
		  $('#limitSubmitStartDate').attr('datatype','*');
		  $('#limitSubmitEndDate').attr('datatype','*');
	  }
 }
  
  
  
/**
 * @description 设置回调.<br>
 * @date 2018/8/27.<br>
 * @author zcg .<br>
 */
function setCallBack(value){
	 if(value==1){
		  $('.callBack').show();
		  $('#callClass').attr('datatype','*');
		  $('#callMethod').attr('datatype','*');
	 }else{
		  $('.callBack').hide();
		  $('#callClass').removeAttr('datatype');
		  $('#callMethod').removeAttr('datatype');
	 }
}

</script>
</body>
</html>